
export default{
  //开启命名空间
  namespaced:true,
  
  state:() =>({
    //用户信息对象
    userinfo:uni.getStorageSync('tbAnsweUser') ,
    //重定向的Object对象
    redirectInfo:null,
	js_code:uni.getStorageSync('js_code')
  }),
  
  mutations:{
    updateUserInfo(state,userinfo){
      state.userinfo = userinfo
       this.commit('m_user/saveUserInfoToStorage')
    },
    saveUserInfoToStorage(state){
		
			console.info("第一次存储结果:"+JSON.stringify(state.userinfo))
      uni.setStorageSync('tbAnsweUser',JSON.stringify(state.userinfo))
    },

    updateRedirectInfo(state,info){
      state.redirectInfo = info
      console.log(state.redirectInfo)
    }
  },
  
  getters:{
    addstr(state){
      if(!state.address.provinceName) return ''
      return state.address.provinceName +state.address.cityName+state.address.countyName+state.address.detailInfo
    }
  }
}